package com.aiyi.education.user.service.impl;


import com.aiyi.education.entity.KsUserGroupWithBLOBs;
import com.aiyi.education.mapper.KsUserGroupMapper;
import com.aiyi.education.user.service.IKsUserGroupService;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Arrays;

/**
 * <p>
 * 用户组 服务实现类
 * </p>
 *
 * @author renyong
 * @since 2020-04-22
 */
@Service
public class KsUserGroupServiceImpl extends ServiceImpl<KsUserGroupMapper, KsUserGroupWithBLOBs> implements IKsUserGroupService {

    @Autowired
    private KsUserGroupMapper ksUserGroupMapper;
    @Override
    public boolean deleteUserGroupById(KsUserGroupWithBLOBs ksUserGroup) {
        ksUserGroupMapper.deleteByPrimaryKey(ksUserGroup.getGroupId());
        return true;
    }

    @Override
    public boolean deleteBatchUsers(String groupIds) {
        ksUserGroupMapper.deleteBatchIds(Arrays.asList(groupIds.split(",")));
        return false;
    }
}
